"%INSERT( )" is a Dialog Processing Statement. It currently has two modes: id and lua. The mode is defined at the start of the insides of the "( )" and is separated from the rest by a ":".
Lua: %INSERT(lua:LUA_CODE)
This replaces the statement with the result of the lua code written after the "lua:".
The lua code must return a string or number.
ID: %INSERT(id:TEXT_FILE_DATA_IDENTIFIER)
This replaces the statement with the text defined in the TextFileData with the given identifier.